package com.good.entity;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.OneToMany;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

@Entity
@Table(name="xx_test2")
@SequenceGenerator(name="myGenerator",sequenceName="xx_test2")
public class Test2 extends BaseEntity{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private String name;
	private Set<Test1> test1=new HashSet<Test1>();
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	@OneToMany(mappedBy="test2",fetch=FetchType.LAZY,cascade=CascadeType.ALL)
	public Set<Test1> getTest1() {
		return test1;
	}
	public void setTest1(Set<Test1> test1) {
		this.test1 = test1;
	}

}
